<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>结伴</title>
    <link rel="icon" href="../static/img/logo2.png" type="image/png">
    <link rel="stylesheet" href="../static/css/companions.css">
    <link rel="stylesheet" href="../static/css/ku/bootstrap.css">
    <link rel="stylesheet" href="../static/css/daohang.css">
    <script src="../static/js/ku/jquery.min.js"></script>
    <script src="../static/js/ku/bootstrap.js"></script>
    <script>
        $(document).ready(function () {
            $('#sub1').click(function () {
                data1 = $('#demo1').val();
                html = $.ajax({
                    url: "/companions/",
                    type: 'POST',
                    data: {'data': data1},
                    success: function (html) {
                        $("#aj1").html(html);
                    }
                });
            })
        })
    </script>

</head>
<body>
<nav class="navbar navbar-expand-md bg-dark navbar-dark">
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#cla1">
        <span class="navbar-toggler-icon"></span>
    </button>
    <img src="../static/img/logo1.png" alt="">
    <div class="collapse navbar-collapse" id="cla1">
        <ul class="navbar-nav" style="margin: 0 10px 0 auto">
            <li class="nav-item">
                <a class="nav-link" href="/homepage/">首页</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="/search/">目的地</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
                    旅游攻略
                </a>
                <div class="dropdown-menu" style="text-align: center">
                    <a class="dropdown-item" href="/travels/">游记</a>
                    <a class="dropdown-item" href="/list/">榜单</a>
                    <a class="dropdown-item" href="/recommend/">景点推荐</a>
                </div>
            </li>
            <li class="nav-item dropdown" style="background: rgb(0,104,183);border-radius: 5px">
                <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
                    社区
                </a>
                <div class="dropdown-menu" style="text-align: center">
                    <a class="dropdown-item" href="/qa/">问答</a>
                    <a class="dropdown-item" href="/companions/">结伴</a>
                </div>
            </li>
            {% if request.session.is_login %}     
                <li class="nav-item"><a href="/house/" class="nav-link">{{ request.session.user_name }}</a></li>
                <li class="nav-item"><a href="/logout/" class="nav-link">注销账号</a></li>
            {% else %}
                <li class="nav-item"><a href="/signin/" class="nav-link">登录/注册</a></li>
            {% endif %}
        </ul>
    </div>
</nav>
<div>
    <div class="row clearfix">

        <div class="col-md-12 column" style="margin: 0;padding: 0;width: 100%">
            <img src="../static/img/jiebantou.jpg" alt="" width="100%">
            <div style="position:absolute;width:4%;height:100px;left:30%;top:50%;">
                <a href="/releasecompanions/">
                    <img src="../static/img/anniu.png" alt="">
                </a>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="column col-2">
        </div>
        <div class="col-md-12 column col-8">
            <h2 id="h21">热门结伴计划</h2>
            <div class="wrapper mod-popular">
                <ul class="clearfix">
                    {% for view in list %}
                        <li class="item" onclick="f({{ view.city_id }})">
                            <a class="_j_hot_mdd" data-mddname="{{ view.city_name }}">

                                <div class="image">
                                    <img src="{{ view.city_img_url }}" style="width: 100%;height: 100%">

                                </div>
                                <div class="txt">
                                    <strong>{{ view.city_name }}</strong>
                                    <p>发起 {{ view.city_companions }} 个结伴</p>
                                </div>
                            </a>
                        </li>
                    {% endfor %}
                </ul>
            <script>
                function f(a) {
                    window.location.href = "/region/?data="+a;
                }
            </script>
            </div>
        </div>
    </div>
    <div class="column col-2">
    </div>

</div>
<hr style="margin-bottom: 0;border: solid 1px">
<div class="row" style="background: #eee">
    <div class="col-md-2 col-1">
    </div>
    <div class="col-md-8 col-10" style="margin-bottom: 40px;margin-top: 10px">
        <div class="col-md-12 column" id="div3">
            <div class="input-group mb-3" style="width: 300px;">
                <input type="text" class="form-control" placeholder="地点" id="demo1" name="didian">
                &nbsp;<button type="submit" class="btn btn-primary btn-sm" style="width: 20%" id="sub1">搜索</button>
            </div>
            <div id="aj1">
                {% for view1 in list1 %}
                    <a href="/companionsotes/?data={{ view1.companions_id }}">
                        <div class="col-md-3 col-6 column">
                            <img src="{{ view1.companions_img_url }}" alt="" width="100%">
                            <hr>
                            <h4>{{ view1.city_name }}</h4>
                            <span style="font-size: 12px">{{ view1.companions_title }}</span>
                            <br>
                            <table>
                                <tr>
                                    <td><img src="{{ view1.user_img }}" class="round_icon" alt=""></td>
                                    <td>
                                        <span style="color: red;font-size: 20px">{{ view1.user_name }}</span></td>
                                </tr>
                            </table>
                            期望人数{{ view1.companions_people_expect }}，{{ view1.companions_people }}人已报名
                        </div>
                    </a>
                {% endfor %}
            </div>
        </div>
    </div>
    <div class="col-md-2 col-1">
    </div>
</div>
<hr style="margin: 0;border: solid 1px">
<div class="row clearfix" style="background:rgba(52,58,64,1)">
    <div class="col-md-2 column">
    </div>
    <div class="col-md-8 column">
        <div id="fool" style="width: 100%;text-align: center;height: 100px;color: #e2e3e5;">
            <p style="margin-top: 20px">© 2018 meetjinn.com 京ICP备0000000号
                <img src="http://images.mafengwo.net/images/footer/police_record.png"
                     width="12" style="margin:0 2px 4px 0;">公网安备000000000号<span
                        class="m_l_10">违法和不良信息举报电话: ---------- 举报邮箱 ----------</span></p>
            <p>网络出版服务许可证：----------<span class="m_l_10">增值电信业务经营许可证：京00000000</span> 营业执照帮助中心<span
                    class="m_l_10">觅景客服:</span><span
                    class="highlight">4006-000-000</span>
            </p>
        </div>
    </div>
    <div class="col-md-2 column">
    </div>
</div>
<div>
    <a class="to-top" style="z-index: 999"><img src="../static/img/Icon/huidao.png" alt="" width="60px"></a>
    <script>!function (o) {
        "use strict";
        o.fn.toTop = function (t) {
            var i = this, e = o(window), s = o("html, body"),
                n = o.extend({autohide: !0, offset: 420, speed: 500, position: !0, right: 15, bottom: 30}, t);
            i.css({cursor: "pointer"}), n.autohide && i.css("display", "none"), n.position && i.css({
                position: "fixed",
                right: n.right,
                bottom: n.bottom
            }), i.click(function () {
                s.animate({scrollTop: 0}, n.speed)
            }), e.scroll(function () {
                var o = e.scrollTop();
                n.autohide && (o > n.offset ? i.fadeIn(n.speed) : i.fadeOut(n.speed))
            })
        }
    }(jQuery);
    $(function () {
        $('.to-top').toTop();
    });
    </script>
</div>
</body>
</html>